package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.OcaFileDao;
import cn.topevery.garden.entity.po.OcaFile;
import cn.topevery.garden.entity.query.OcaFileQuery;
import cn.topevery.garden.entity.vo.OcaFileVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class OcaFileLogic extends BaseLogic<OcaFile> {
    @Autowired
    OcaFileDao ocaFileDao;

    @Override
    public BaseEntityDao<OcaFile, Integer> getDao() {
        return ocaFileDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<OcaFileVO> listPage(OcaFileQuery query) {
        return ocaFileDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        ocaFileDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param ocaFile 实体
     */
    public void saveOrUpdate(String userId, OcaFile ocaFile){
        ocaFileDao.saveOrUpdate(userId,ocaFile);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public OcaFile getEntityByColumn(String key, String value) {
        return ocaFileDao.getEntityByColumn(key, value);
    }

    public void updateByMainId(Integer mainId) {
        ocaFileDao.updateByMainId(mainId);
    }

    public List<OcaFile> getListByMainId(Integer id) {
        return ocaFileDao.getListByMainId(id);
    }
}
